package com.lc.user.express.httpserver;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

/**
 * Created by Administrator on 2016/4/11.下单
 */
@HttpInlet(Net.GET_ORDER_COMMIT)
public class GetOrderCommit extends ZJDBAsyGet<GetOrderCommit.Info> {
    public String datetime,cid,account,tip,saycontent,userid,couponid,backmoney,address,cityid;
    public int payttime,paytype,ismove,isbackorder,isbackmoney,datetype;

    public GetOrderCommit(String cityid,int datetype,String datetime, String cid,String account,String tip,String saycontent,
                          String address, String userid,String couponid,String backmoney,int payttime,int paytype,
                          int ismove, int isbackorder,int isbackmoney,AsyCallBack listener) {
        super(listener);
        this.cityid = cityid;
        this.datetype = datetype;
        this.datetime = datetime;
        this.cid = cid;
        this.account = account;
        this.tip = tip;
        this.saycontent = saycontent;
        this.couponid = couponid;
        this.backmoney = backmoney;
        this.payttime = payttime;
        this.paytype = paytype;
        this.ismove = ismove;
        this.isbackorder = isbackorder;
        this.isbackmoney = isbackmoney;
        this.userid = userid;
        this.address = address;


    }

    @Override
    protected Info parser(JSONObject object) {
        if (object.optInt("message") == 1) {
            Info info = new Info();
            info.orderid = object.optString("orderid");
            TOAST = "订单提交成功";
            return info;
        }else {
            TOAST = "订单提交失败";
        }
        return null;
    }

    public static class Info {
        public String orderid;
    }
}
